Create basic vertical alignment between 2 points
Vertical alignments can be created using different methods, the below code shows profile creation using 2 points on existing horizontal alignment.
internal bool CreateVerticalAlignment(Alignment alignment)
{
//ConsensusConnectionEdit allows the persistence of civil objects to the dgn
Bentley.CifNET.SDK.Edit.ConsensusConnectionEdit con = Bentley.CifNET.SDK.Edit.ConsensusConnectionEdit.GetActive();
//Define 2 points here for profile geometry creation assuming Slope = 10
Bentley.GeometryNET.DPoint3d point1 = new Bentley.GeometryNET.DPoint3d(0, 50);
Bentley.GeometryNET.DPoint3d point2 = new Bentley.GeometryNET.DPoint3d(800, 60);
//Create geometry ProfileLine from 2 points
Bentley.CifNET.LinearGeometry.ProfileLine profileLine = new Bentley.CifNET.LinearGeometry.ProfileLine(point1, point2);
if (profileLine == null) return false;
//create profile
Bentley.CifNET.GeometryModel.SDK.Profile profile = alignment.CreateProfileByProfileElement(profileLine, true, false);
if (profile == null) return false;
//Set feature definition to profile
profile.SetFeatureDefinition("Alignment\\Geom_Baseline", "ProfileLondonRd");
return true;
}
CreateProfileByProfileElement() is used here to create profile on existing alignment named as "alignment". ProfileLine is passed as an argument to this function which is created using 2 points.